package com.shixun.milktea.mapper;

import com.shixun.milktea.entity.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shixun.milktea.entity.Orderdetail;


import com.shixun.milktea.vo.OrderVo;
import com.shixun.milktea.vo.SaleVo;


import com.shixun.milktea.vo.MtlistVo;


import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zrs
 * @since 2022-06-07
 */
public interface OrderMapper extends BaseMapper<Order> {
    /*
     * @Description: 插入订单对象返回该订单id
     * @param order: 订单对象
     * @return: java.lang.Integer
     */
    public Integer addOneOrder(@Param("order") Order order);

    List<Order> findAllOrderAndDetails();

    List<Order> findOrderByPhone(@Param("phoneNumber") String phoneNumber);

    Order findAllOrderAndDetailsById(@Param("orderId") Integer orderId);


    Integer updateOrderById(@Param("order") Order order);

    /*
     * @Description: 找到近七天的销售情况
     */
    List<SaleVo> findSaleCount();



//    Orderdetail findDetailsById(@Param("orderId") Integer orderId);
    /**
     * 找出销量排前五的奶茶
     * @return
     */
    List<MtlistVo> findOrderGroupFiveMt();


    List<Order> findAllOrderId();

    List<Order> findOrderByConsumerId(@Param("consumerId") Integer consumerId);


    List<Order> findOrderByIdAndStatus(@Param("consumerId") Integer consumerId,@Param("orderStatus") String orderStatus);

    Integer createOrder(@Param("orderVo")OrderVo orderVo);

}
